﻿<phone:PhoneApplicationPage
    x:Class="wp8nop.DettaglioProdotto"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    DataContext="{Binding DettaglioProdotto, Source={StaticResource Locator}}"
    shell:SystemTray.IsVisible="True"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    toolkit:TiltEffect.IsTiltEnabled="True">
    <phone:PhoneApplicationPage.Resources>
        
    </phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot è la griglia radice in cui viene inserito tutto il contenuto della pagina-->
    <Grid x:Name="LayoutRoot" Background="White">
        <!--Controllo Pivot-->
        <Grid Height="55" Margin="0" VerticalAlignment="Top">
            <Grid.Background>
                <SolidColorBrush Color="#FFE3AACC"/>
            </Grid.Background>
        </Grid>
        <!--Controllo Pivot-->
        <phone:Pivot Title="24CARATI.COM" Background="{x:Null}" Foreground="Black">
            <!--Elemento Pivot uno-->
            <phone:PivotItem Header="immagine">
                <Grid Grid.Row="1">
                    <ProgressBar
                    VerticalAlignment="Top"
                    Background="{x:Null}"
                    Margin="0,0,0,0"
                    Foreground="Red"
                    IsIndeterminate="{Binding IsLoading}"/>

                    <Image x:Name="img" Source="{Binding Prodotto.Model.imgs.main}"/>
                </Grid>
            </phone:PivotItem>

            <!--Elemento Pivot due-->
            <phone:PivotItem Header="dettagli">
                <ScrollViewer>
                    <StackPanel>
                        <TextBlock Margin="0,10,0,0"  Text="{Binding Prodotto.Model.name}" FontSize="36" TextWrapping="Wrap"/>
                        <TextBlock Margin="0,10,0,0" FontSize="24" Text="{Binding Prodotto.Model.desc.breve}"  TextWrapping="Wrap"/>
                        <Border Margin="20,10,20,10" BorderThickness="0,1,0,0" BorderBrush="#FFC3C3C3"/>
                        <Grid Margin="0,20,0,0" HorizontalAlignment="Center">
                            <StackPanel Orientation="Horizontal" >
                                <TextBlock Text="Prezzo: " FontSize="30"/>
                                <Grid>
                                    <TextBlock Text="{Binding Prodotto.OriginalPrice}" FontSize="30"/>
                                    <Border BorderBrush="Black" BorderThickness="0,1,0,0" VerticalAlignment="Center"/>
                                </Grid>
                                <TextBlock Margin="8,0,0,0" FontSize="30" Text="{Binding Prodotto.Price}"/>

                            </StackPanel>
                        </Grid>
                        <Border Margin="20,30,20,10" BorderThickness="0,1,0,0" BorderBrush="#FFC3C3C3"/>

                        <TextBlock Margin="0,20,0,0" FontSize="34" Text="{Binding Prodotto.Spedizione}"  TextWrapping="Wrap" HorizontalAlignment="Center"/>
                        <Button Margin="0,20,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="0" Style="{StaticResource ButtonStyle1}" >
                            <Image Width="250" Tap="Acquista_Click" Source="/Assets/Acquista.png"/>
                        </Button>
                    </StackPanel>
                </ScrollViewer>
            </phone:PivotItem>
        </phone:Pivot>

    </Grid>
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Assets/home.png" Text="Home" Click="GoToHome_Click"/>
            <shell:ApplicationBarIconButton IconUri="/Assets/cart.png" Text="Carrello" Click="ApplicationBarIconButton_Click"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>